/**
 * TabVD is a Virtual Desktop Client/Server designed specifically for connecting
 * from Tablet like devices.
 *
 * Copyright (C) 2011 Subhabrata Ghosh
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * TestMain.cpp
 *
 *  Created on: May 24, 2011
 *      Author: subhagho
 */
#include <stdio.h>
#include <unistd.h>

#include <common/AbstractConfiguration.h>
#include <common/PropertiesConfiguration.h>
#include <common/FileLogger.h>
#include <common/Monitor.H>
#include <service/ServiceGlobal.H>
#include <common/DateTime.h>

int main(char** argv, int argc) {
    char* user = getenv("USER");
    if (user)
        printf("User : %s\n", user);

    std::string cdeffile("/Work/Dev/tabvd/server/tabvd.main/data/config.setup");
	tabvd::AbstractConfiguration* config = new tabvd::PropertiesConfiguration(&cdeffile);
	if (config){
		config->init("/Work/Dev/tabvd/server/tabvd.main/data/config.prop");

        tabvd::AbstractLogger* logger = new tabvd::FileLogger();
        if (logger) {
            //logger->createDefault(config);
            logger->init(config);
            LPSERROR(logger, "This is the first message...");
            delete logger;
        }
		//config->save();
		delete config;
	}
    
    std::string tmp(getenv("TEMP"));
    printf("Temp dir : %s\n", tmp.c_str());

	return 0;
}

